#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<time.h>

void printArray(int * array,int number){

    int index = 0;
    for(;index < number;index++){

        if(array[index] == 1){

            printf("%c.",index + 'A');
        }
    }
    printf("\n");
}
void combineHelp(int * arr,int index,int number,int selected,int select){

    if(selected == select){

        printArray(arr,number);
    }
    if(index == number){

        return;
    }
    arr[index] = 1;
    combineHelp(arr,index+1,number,selected+1,select);

    arr[index] = 0;
    combineHelp(arr,index+1,number,selected,select);
}
void combine(int * arr,int number,int select){

    combineHelp(arr,0,number,0,select);
}

int
main(int argc,char * argv[]){

    if(argc!=3){

        printf("need two position integer.\n");
        return EXIT_FAILURE;
    }
    int num = (int)strtol(argv[1],NULL,10);
    if(num <= 0){

        printf("number isn't position integer.\n");
        return EXIT_FAILURE;
    }
    int select = (int)strtol(argv[2],NULL,10);
    if(select <= 0 || (select > num)){

        printf("condition is not take.\n");
        return EXIT_FAILURE;
    }
    int * arr = (int*)malloc(sizeof(int)*num);
    int ind;
    for(ind = 0;ind < num;++ind){

        arr[ind] = 0;
    }
    combine(arr,num,select);

    free(arr);
    return EXIT_SUCCESS;
}